<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./js/vue.js"></script>
  </head>

  <body>
    <div id="app">
      <input type="text" v-model="msg" />
      <input type="text" v-model="com" />
    </div>
    <script>
      let app = new Vue({
        el: '#app',
        data: {
          msg: 'kkk',
        },
        computed: {
          com: {
            // set和get名字是固定的
            //当改变som的返回值后，就会调用set方法
            set(val) {
              // return this.msg;
            },
            get() {
              return this.msg
            },
          },
        },
      })
    </script>
  </body>
</html>
